export default function($axios) {
  return {
    login: ({ account, password }) =>
      $axios.post('/retailadmin/user/login', { account, password }),
    getUserInfo: () => $axios.get('/retailadmin/user/getuserinfo'),
    // 注册获取验证码
    sendVerificationCode: data =>
      $axios.post('/retailadmin/user/sendVerificationCode', data),
    // 注册引导--基本信息
    register: ({ account, event, password, captcha }) =>
      $axios.get('/retailadmin/user/register', {
        params: { account, event, password, captcha }
      }),
    // 重置密码
    resetPassword: data =>
      $axios.post('/retailadmin/admin/resetPassword', data),
    addappinfo: ({
      title,
      province_id,
      city_id,
      district_id,
      location_detail,
      longitude,
      latitude,
      is_jump
    }) =>
      $axios.get('/retailadmin/user/addappinfo', {
        params: {
          title,
          province_id,
          city_id,
          district_id,
          location_detail,
          longitude,
          latitude,
          is_jump
        }
      }),
    // 获取注册步骤
    getAppRegisterStepInfo: () =>
      $axios.post('/retailadmin/user/getAppRegisterStepInfo'),
    // 个性化选择应用（注册第二步）
    addRegisterTwo: ({ select_info, is_jump }) =>
      $axios.post('/retailadmin/user/addRegisterTwo', {
        select_info,
        is_jump
      }),
    // 获取所有应用列表
    getApplyList: ({ current_page, page_number }) =>
      $axios.post('/retailadmin/application/getList', {
        current_page,
        page_number
      }),
    /**
     * 角色
     */
    // 获取角色列表
    getRoleList: data =>
      $axios.post('/retailadmin/admin_user/getRoleList', data),
    // 添加角色
    addRole: data => $axios.post('/retailadmin/admin_user/addRole', data),
    // 修改角色
    editRole: data => $axios.post('/retailadmin/admin_user/editRole', data),
    // 获取角色详情
    getRoleInfo: data =>
      $axios.post('/retailadmin/admin_user/getRoleInfo', data),
    /**
     * 员工
     */
    // 添加员工
    addAdmin: data => $axios.post('/retailadmin/admin_user/addAdmin', data),
    // 获取员工列表
    getAdminList: data =>
      $axios.post('/retailadmin/admin_user/getAdminList', data),
    // 获取员工详情
    getAdminInfo: data =>
      $axios.post('/retailadmin/admin_user/getAdminInfo', data),
    // 编辑员工
    editAdmin: data => $axios.post('/retailadmin/admin_user/editAdmin', data),
    // 获取用户拥有的所有权限
    getpemission: data => $axios.post('/retailadmin/user/getpemission', data),
    // 获取用户列表
    getUserList: data => $axios.post('/retailadmin/user/userList', data),
    // 获取积分记录
    userIntegralRecord: data =>
      $axios.post('/retailadmin/user/userIntegralRecord', data),
    // 获取余额记录
    userBalanceRecord: data =>
      $axios.post('/retailadmin/user/userBalanceRecord', data),
    // 获取交易记录
    userTradeRecord: data =>
      $axios.post('/retailadmin/user/userTradeRecord', data)
  }
}
